{include file="header"}
<div class="layui-card-body" style="padding: 15px;">
<!--基本设置-->
  <div class="layui-fluid">
      <div class="layui-card">
        <!--<div class="layui-tab layui-tab-brief">-->
        <!--   <ul class="layui-tab-title">-->
        <!--      {volist name=":fun_s('set',array(),'id asc',30,1)" id="vo"}-->
        <!--      <a href="{:url('admin/admin/set',array('id'=>$vo.id))}"><li {if get('id')==$vo.id}class="layui-this"{/if}>{$vo.name}</li></a>-->
        <!--      {/volist}-->
              <!--<li onclick="x_admin_show('添加','{:url('admin/admin/set_add')}',300,200)">添加设置</li>-->
        <!--   </ul>-->
        <!--</div>  -->
        <div class="layui-card-body" style="padding: 15px;">
        <style type="text/css">
        .layui-form-label {
          width: 100%;
          text-align: left;
          background-color: #f2f2f2;
          padding: 10px 0px;
          }
         .layui-input-block {
          margin-left: 0px;
          }
        </style>
        <form class="layui-form" url="{:url('admin/admin/set')}" t_url="javascript:location.reload();">
        <input type="hidden" name="model" value="set">
        <input type="hidden" name="id" value="{:get('id')}">
        <!-- <blockquote class="layui-elem-quote">
          <button type="button" onclick="x_admin_show('添加{:fun_sc_p('set', array('id'=>get('id')), 'name')}','{:url('admin/admin/set_config',array('id'=>get('id')))}',300,400)" class="layui-btn layui-btn-xs">添加{:fun_sc_p('set', array('id'=>get('id')), 'name')}</button>
          <button type="button" class="layui-btn layui-btn-xs layui-btn-danger del_t" t_url="{:url('admin/admin/set')}" url="{:url('admin/api/catedelete')}?model=set&id={:get('id')}" name="确定要删除这条配置吗？<br>删除不可恢复 请谨慎" style="float: right;">删除</button>
        </blockquote> -->
        {volist name=":fun_s('set_config',array(tid=>get('id')),'px desc',3000,1)" id="vo"}
         <!-- 输入框 -->
         {if $vo.type==1}
          <div class="layui-form-item" {if $vo.var=='muban'}style="display:none;"{/if}>
            <div class="layui-form-label">
              <span style="margin-left:10px;">{$vo.name} <!-- &#123;:set('{$vo.var}',{:get('id')})&#125; --></span>
              <!-- <a href="javascript:;" style="float: right;margin-right:10px;color: #ec0000;" onclick="x_admin_show('编辑','{:url('admin/admin/set_config',array('id'=>get('id'),'or'=>$vo.id))}',300,400)">编辑</a> -->
            </div>
              <input type="text" name="config[{$vo.var}]" value="{if condition="socha(user('tid'),'99') eq '1'"}{:set($vo.var,get('id'))}{else/}并无权限查看{/if}" autocomplete="off" placeholder="请输入" class="layui-input">
          </div>
          {/if}
          {if $vo.type==2}
          <!-- 文本域 -->
          <div class="layui-form-item layui-form-text">
            <div class="layui-form-label">
              <span style="margin-left:10px;">{$vo.name} <!-- &#123;:set('{$vo.var}',{:get('id')})&#125; --></span>
              <!-- <a href="javascript:;" style="float: right;margin-right:10px;color: #ec0000;" onclick="x_admin_show('编辑','{:url('admin/admin/set_config',array('id'=>get('id'),'or'=>$vo.id))}',300,400)">编辑</a> -->
            </div>
              <textarea name="config[{$vo.var}]" placeholder="请输入内容" class="layui-textarea" style="height: {$vo.high}px;">{:set($vo.var,get('id'))}</textarea>
          </div> 
          {/if}
          {if $vo.type==3}
          <!-- 附件上传 -->
          <div class="layui-form-item">
            <div class="layui-form-label">
              <span style="margin-left:10px;">{$vo.name} <!-- &#123;:set('{$vo.var}',{:get('id')})&#125; --></span>
              <!-- <a href="javascript:;" style="float: right;margin-right:10px;color: #ec0000;" onclick="x_admin_show('编辑','{:url('admin/admin/set_config',array('id'=>get('id'),'or'=>$vo.id))}',300,400)">编辑</a> -->
            </div>
                <button type="button" class="layui-btn layui-btn-normal ups{$vo.id} doup"><i class="iconfont">&#xe71d;</i>上传</button>
                <input type="text" name="config[{$vo.var}]" id="up{$vo.id}" value="{:set($vo.var,get('id'))}" autocomplete="off" class="layui-input" style="padding-left: 80px;">
          </div>
          <script type="text/javascript">
          layui.use(['form', 'upload', 'jquery']
          ,function(){
              var form = layui.form,
              upload = layui.upload,
              jq = layui.jquery;
              upload.render({
              elem: '.ups{$vo.id}',
              url: "{:url("admin/up/up")}",
              accept: 'file',
              done: function(res) {
                  if (res.code == '1') {
                    jq('#up{$vo.id}').val(res.path);
                    return layer.msg(res.msg);
                  } else {
                    return layer.msg(res.msg);
                  }
              }
            });
          });
          </script>
          {/if}
          {if $vo.type==4}
          <!-- 选择框 -->
          <div class="layui-form-item layui-form-text">
            <div class="layui-form-label">
              <span style="margin-left:10px;">{$vo.name}<!--  &#123;:set('{$vo.var}',{:get('id')})&#125; --></span>
              <!-- <a href="javascript:;" style="float: right;margin-right:10px;color: #ec0000;" onclick="x_admin_show('编辑','{:url('admin/admin/set_config',array('id'=>get('id'),'or'=>$vo.id))}',300,400)">编辑</a> -->
            </div>
            <input type="radio" name="config[{$vo.var}]" value="1" title="是" {if set($vo.var,get('id'))==1}checked="选择"{/if}>
            <input type="radio" name="config[{$vo.var}]" value="0" title="否" {if set($vo.var,get('id'))==0}checked="选择"{/if}>
          </div> 
          {/if}
          {if $vo.type==5}
          <!-- 描述 -->
          <blockquote class="layui-elem-quote">
          {$vo.name}
          <!-- <a href="javascript:;" style="float: right;margin-right:10px;color: #ec0000;" onclick="x_admin_show('编辑','{:url('admin/admin/set_config',array('id'=>get('id'),'or'=>$vo.id))}',300,400)">编辑</a> -->
          </blockquote>
          {/if}
          {/volist}
          <!-- 提交 -->
          <div class="layui-form-item layui-layout-admin">
            <div class="layui-input-block">
              <div class="layui-footer" style="left: 0;">
                <button class="layui-btn" lay-submit="" lay-filter="cms">保存</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
</div>
{include file="footer"}